package top.luoblog.observer.withoutjdk;

/**
 * @author : luo
 * @description : 观察者
 */
public class SaveObserver implements Observer {

    private int count;

    private Subject subject;

    public SaveObserver(Subject subject) {
        subject.registerObserver(this);
        this.subject = subject;
    }

    @Override
    public void update(int count) {
        this.count = count;
        System.out.println("SaveObserver: " + this.count);
    }

}
